﻿using System;

namespace Sessionizer.Core
{
    /// <summary>
    /// Configuration for session.
    /// Can be passed to <see cref="ISessionFactory.Create()"/> as parameter.
    ///  </summary>
    public interface ISessionConfiguration
    {
        /// <summary>
        /// Checks custom factory for type.
        /// </summary>
        /// <param name="type">Data type</param>
        /// <returns>True, if custom factory for data type is declared in configuration.</returns>
        bool IsDeclared(Type type);

        /// <summary>
        /// Returns custom factory type.
        /// Throws <see cref="ArgumentOutOfRangeException"/> if there is no declaration.
        /// </summary>
        /// <param name="type">Data type</param>
        /// <returns>Type of custom factory for data type.</returns>
        Type Declared(Type type);
    }
}